package com.kaver.sso.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.kaver.sso.interceptor.AuthInterceptor;
import com.kaver.sso.interceptor.RightInterceptor;

import javax.annotation.Resource;


@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Resource
    private AuthInterceptor authInterceptor;
    @Resource
    private RightInterceptor rightInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authInterceptor).addPathPatterns("/**").order(-100);
        registry.addInterceptor(rightInterceptor).addPathPatterns("/**").order(-99);
    }

}